Skip to main content

All Questions

2votes
1answer
310views

Pick two random cards from a standard deck

I wrote this code as a refactor of code I saw on Programiz. I thought about this refactor before going to bed and implemented it successfully in code. ...
dylanm's user avatar
2votes
3answers
1kviews

Grouping objects in a JavaScript array by category and counting them

I recently had a programming interview with a Silicon Valley tech company and wanted some different opinions on one of the problems they had me solve and how others might complete it. Essentially, ...
MaWinf98's user avatar
1vote
6answers
239views

Find first and last matches on a sorted list

I needed a function to find the first and last indices into a sorted list corresponding to a given value (roughly similar to C++'s equal_range()). This is the ...
ajax333221's user avatar
3votes
2answers
197views

Check for max value in stack

Got this problem in a coding interview - Get the max value of a stack in O(1). The stack contains numbers only. Please review my solution. ...
G.R's user avatar
  • 39
2votes
3answers
1kviews

Find the 'n' most frequent words in a text, aka word frequency

I'm doing freeCodeCamp's Coding Interview Prep to improve my JavaScript skills. This challenge is called "Word Frequency", and is based on the Rosetta Code's entry of the same name. The ...
NPN328's user avatar
-1votes
1answer
343views

Hackerrank Gridland Metro - using Interval Cover Solution [closed]

Hi there I was hoping to get a better grasp of greddy algorithms while trying to solve this problem: Hackerrank: Gridland Metro and I was trying to apply an algorithm where each grid could be ...
Elliott de Launay's user avatar
1vote
1answer
379views

Square Spiral Matrix in Javascript

I've been grinding some Leetcode for an interview coming up and just completed Square Spiral in Javascript. Looking for feedback on performance. This ranked faster than 58% of submissions, would there ...
Samuel Samuelson's user avatar
1vote
1answer
122views

Is My Controller too Coupling?

To put it in context, I had the assignment to do for a job interview in Node.JS, which basically making CRUD with products (and it have certain conditions). The assignment was well-understandable, and ...
Eloic08's user avatar
4votes
1answer
218views

Randomly rearrange table rows without unnecessary reflows

I recently completed a coding challenge for a company that did not get me to the next stage. They were kind enough to provide the following feedback: The coding assignment does not match what we are ...
j-scu486's user avatar
2votes
0answers
628views

Cron expression parser

Problem Write a command line application or script which parses a cron string and expands each field to show the times at which it will run. ~$ your-program "*/15 0 1,15 * 1-5 /usr/bin/find"...
CodeYogi's user avatar
2votes
5answers
258views

FizzBuzz solution

I'm preparing for junior developer interviews and am trying to come up with a more interesting/versatile solution to FizzBuzz than I've done in the past. Do you have any ideas of how I might DRY this ...
novafeels's user avatar
2votes
1answer
1kviews

Implementation of a ticket queue system in JavaScript

I got this question during an interview. The question itself was very open-ended - it asked me to implement a ticket queue system, where by default it would have 3 different queues to hold tickets ...
Joji's user avatar
  • 325
3votes
2answers
567views

Build a stamp duty calculator for various types of buyers

I had a task where I had to build a stamp duty calculator, which calculates the tax or stamp duty first-time buyers(ftb) returning buyers (...
user6248190's user avatar
4votes
3answers
618views

Microsoft OA | Longest Substring Without 3 Contiguous Occurrences of Letter

For the following question, does my JS Solution seem correct? I'm looking for some peer review. Q: Given a string s containing only a and b, find longest substring of s such that s does not contain ...
Benny Joo's user avatar
7votes
2answers
1kviews

Take postcodes and get the Lat long information from them

I had an interview task which was the final stage, however, the feedback I got back for my solution was that it lacked effort and structure. I would be grateful to ...
user6248190's user avatar

153050per page
close